﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Data.Linq;
using System.Web.UI.WebControls;
using ASPMVCUtil.ExcelExporter;

namespace System.Web.Mvc
{
    public static class ExcelControllerExtensions
    {
        public static ActionResult Excel<TModel>
        (
            this Controller controller,
            IEnumerable<TModel> rows,
            string fileName,
            IEnumerable<ExcelColumn<TModel>> columns
        )
        {
            return new ExcelResult<TModel>(rows, fileName, columns);
        }
    }
 }